home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-07-29 | 735 b | 15 lines | [TEXT/MPS ] |
- # OpenStatus - script to determine the open/closed status of a file
-
- Set RetVal 0 # default return value is closed (returned in case of error)
- Set NFile {#} # Get number of command line arguments
- If ({NFile} == 1)
- Set Attributes "`Files -n -x a "{1}" ≥ Dev:Null`"
- Set Attributes "`Echo "{Attributes}" | StreamEdit -d -e '/(≈ )*([¬ ]*)®1/ Print ®1' ≥ Dev:Null`" # strip out the file's attributes
- Set OpenStatus "`Echo "{Attributes}" | StreamEdit -d -e '/(≈p)*([¬i]*)®1/ Print ®1' ≥ Dev:Null`" # strip out the file's open status
- If ({OpenStatus} == "O")
- Set RetVal 1 # indicate an open file
- End # If {OpenStatus}
- End # If {NFile}
- Exit {RetVal}
-
- # end of OpenStatus